package com.example.analysis.controller;

import com.example.analysis.domain.EvaluateListInfo;
import com.example.analysis.domain.ScoreInfo;
import com.example.analysis.domain.SupervisionListInfo;
import com.example.analysis.domain.TimeInfo;
import com.example.analysis.entity.Course;
import com.example.analysis.service.EvaluateSupervisionService;
import com.example.analysis.utils.Response1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author：txy
 * @name：SupervisionEvaluateAnalysis
 * @Date：2025/4/26
 * @Filename：SupervisionEvaluateAnalysis
 */
@RestController
@RequestMapping("/supervisionEvaluate")
public class SupervisionEvaluateAnalysis {

    @Autowired
    EvaluateSupervisionService evaluateSupervisionService;

    @GetMapping("/course/{semester}")
    public Response1<List<ScoreInfo>> getCourse(@PathVariable("semester") String semester){
        List<ScoreInfo> list=evaluateSupervisionService.getCourse(semester);
        Response1<List<ScoreInfo>> listResponse1 = new Response1<>(20000, "成功", list);
        return listResponse1;
    }

    @GetMapping("/time")
    public Response1<List<SupervisionListInfo>> getTimeInfo(SupervisionListInfo supervisionListInfo){
        List<SupervisionListInfo> list = evaluateSupervisionService.getTimeInfo(supervisionListInfo);
        return new Response1<>(20000,"成功",list);
    }

    @GetMapping("/diffSemester")
    public Response1<List<SupervisionListInfo>> getDiffSemester(SupervisionListInfo supervisionListInfo){
        List<SupervisionListInfo> list=evaluateSupervisionService.getDiffSemester(supervisionListInfo);
        return new Response1<>(20000,"成功",list);
    }

    @GetMapping("/classOne")
    public Response1<List<Course>> getClassOne(){
        List<Course> list=evaluateSupervisionService.getClassOne();
        return new Response1<>(20000,"成功",list);
    }
}
